package com.padakeji.android.pworks.content;

import android.content.Context;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;

import com.padakeji.android.pworks.R;

/**
 * Created by AtanL on 2015/9/16.
 */
public class PadaImageLoaderFactory {

    private static PadaImageLoader mImageLoader;

    public static PadaImageLoader getImageLoader(Context context) {
        return getImageLoader(context, R.drawable.ic_launcher, R.drawable.ic_launcher);
    }

    public static PadaImageLoader getImageLoader(@NonNull Context context, @DrawableRes int imageOnLoading, @DrawableRes int imageOnFailure) {
        synchronized (PadaImageLoaderFactory.class) {
            if (mImageLoader == null) {
                mImageLoader = new UniversalImageLoaderWrapper(context, imageOnLoading, imageOnFailure);
            }
        }
        return mImageLoader;
    }

}
